package com.mingshine.cloud;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableAsync;

@SpringBootApplication
@EnableAsync
@Configuration
public class NettyApplication {

    public static void main(String[] args) {
        SpringApplication.run(NettyApplication.class, args);
    }

    //    @Async
//    @Override
//    public void run(String... args) throws Exception {
//        new BootNettyServer().bind(8888);
//    }
	@Bean
	public BootNettyServer mBootNettyServer() throws Exception {
        BootNettyServer bootNettyServer = new BootNettyServer();
        bootNettyServer.bind(8888);
        return  bootNettyServer;

    }

}
